﻿using System.Globalization;
using System.IO;
using System.Text;

namespace Z.IconLibraryGenerator.WinForm
{
    public partial class IconLibraryGeneratorManager
    {
        public static string GetIncludeExtensionsText(ProjectConfiguration project)
        {
            var sb = new StringBuilder();

            foreach (var item in project.Icons)
            {
                sb.Append(GetIncludeExtensionsText(project, item));
            }

            return sb.ToString();
        }

        public static string GetIncludeExtensionsText(ProjectConfiguration project, ProjectIcon config)
        {
            const string template = @"    <Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetWebResourceUrl.cs"" />
    <Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetBitmap.cs"" />
    <Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetStream.cs"" />
	<Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetIcon.cs"" />
    <Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetImage.cs"" />
    <Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetCssClass.cs"" />
    <Compile Include=""ExtensionMethods\@(Model.DestinationName)\Icon.GetUrl.cs"" />";

            return template.Replace("@(Model.DestinationName)", config.Prefix);
        }
    }
}